package com.woniu.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;

@Slf4j
@Configuration
public class CodeResert {

    @Autowired
    private RedisTemplate redisTemplate;

    @Scheduled(cron = "0 0 12 * * ?")
    public void clearImage() throws Exception {
        log.debug("========开始重置验证码次数==========");
        if (redisTemplate.hasKey("sendSms")) {
            redisTemplate.delete("sendSms");
        }
        log.debug("========重置验证码次数成功==========");

    }
}
